package com.example.zhaohang.grildlayoutandview;


import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

/**
 * Created by 赵航 on 2017/8/26.
 */

public class MyView extends LinearLayout {

    private View mView;
    private LinearLayout mLinearLayout;
    private TextView mTextView;
    private ImageView mImageView;

    public MyView(Context context) {
        this(context,null);
    }

    public MyView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);

        mView = View.inflate(getContext(), R.layout.myview, this);

        mLinearLayout = (LinearLayout) mView.findViewById(R.id.view_linelayout);
        mTextView = (TextView) mView.findViewById(R.id.view_text);
        mImageView = (ImageView) mView.findViewById(R.id.view_image);
    }
    public LinearLayout getLinearLayout(){

        return mLinearLayout;
    }

    public ImageView getImageView() {

        return mImageView;
    }

    public TextView getTextView() {

        return mTextView;
    }
}
